
	function docAdjust() {
		//获取所有页面
		let pages = $(".page");
		let pageNum = pages.length;
		
		//获取页面的内容高度		
		for (let index = 0; index < pageNum; index++) {
			let page = pages[index];
			//获取页头
			//var pageHeader = $(page).children(".page-header")[0];
			//var pageFooter = $(page).children(".page-footer")[0];
			let pageContent = $(page).children(".page-content")[0];
			let sh = pageContent.scrollHeight;
			let oh = pageContent.offsetHeight;

			if(sh>oh){
				let rows = $(pageContent).children(".row");
				let curRow = firstPage(rows, oh);
				createPage(page,rows,curRow+1,oh);
			}			
		}
	}

	
	/**
	 * 创建新页面
	 */
	function createPage(page, rows, startRow,oh) {
		let newPage = page;
		let preHeader = $(newPage).children(".page-header").html();
		let preFooter = $(newPage).children(".page-footer").html();
		let len = rows.length;
		while(startRow < len){
			//新页面
			let clonePage = $("<div class='page'></div>");
			let pageContent = $("<div class='page-content'></div>");
			let pageHeader = $("<div class='page-header'></div>");
			$(pageHeader).html(preHeader);
			let pageFooter = $("<div class='page-footer'></div>");
			$(pageFooter).html(preFooter);
			
			$(clonePage).append(pageHeader);
			$(clonePage).append(pageFooter);
			$(clonePage).append(pageContent);
			$(newPage).after(clonePage);
			newPage = clonePage;
			let nh = 0;
			for (; startRow < len;) {
				let row = rows[startRow];
				nh = nh + row.offsetHeight;
				if (nh <= oh) {
					$(pageContent).append(row);
					startRow++;
				} else {
					break;
				}
				
			}
			
		}
		
	}

	/**
	 * 获取第一页的行数
	 */
	function firstPage(rows, oh) {
		let nh = 0;
		let curRow = 0;
		let rl = rows.length;
		for (let i = 0; i < rl; i++) {
			let row = rows[i];
			nh = nh + row.offsetHeight;
			if (nh <= oh) {
				curRow = i;
			} else {
				break;
			}
		}
		return curRow;
	}